package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the IND_PRTC database table.
 * 
 */
@Embeddable
public class IndPrtcPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private long refnumPart;
	private String curPrtc;
	private String nuTitu;
	private String codPartic;
	private String aaTitu;

    public IndPrtcPK() {
    }

	@Column(name="REFNUM_PART", unique=true, nullable=false)
	public long getRefnumPart() {
		return this.refnumPart;
	}
	public void setRefnumPart(long refnumPart) {
		this.refnumPart = refnumPart;
	}

	@Column(name="CUR_PRTC", unique=true, nullable=false, length=14)
	public String getCurPrtc() {
		return this.curPrtc;
	}
	public void setCurPrtc(String curPrtc) {
		this.curPrtc = curPrtc;
	}

	@Column(name="NU_TITU", unique=true, nullable=false, length=8)
	public String getNuTitu() {
		return this.nuTitu;
	}
	public void setNuTitu(String nuTitu) {
		this.nuTitu = nuTitu;
	}

	@Column(name="COD_PARTIC", unique=true, nullable=false, length=3)
	public String getCodPartic() {
		return this.codPartic;
	}
	public void setCodPartic(String codPartic) {
		this.codPartic = codPartic;
	}

	@Column(name="AA_TITU", unique=true, nullable=false, length=4)
	public String getAaTitu() {
		return this.aaTitu;
	}
	public void setAaTitu(String aaTitu) {
		this.aaTitu = aaTitu;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof IndPrtcPK)) {
			return false;
		}
		IndPrtcPK castOther = (IndPrtcPK)other;
		return 
			(this.refnumPart == castOther.refnumPart)
			&& this.curPrtc.equals(castOther.curPrtc)
			&& this.nuTitu.equals(castOther.nuTitu)
			&& this.codPartic.equals(castOther.codPartic)
			&& this.aaTitu.equals(castOther.aaTitu);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.refnumPart ^ (this.refnumPart >>> 32)));
		hash = hash * prime + this.curPrtc.hashCode();
		hash = hash * prime + this.nuTitu.hashCode();
		hash = hash * prime + this.codPartic.hashCode();
		hash = hash * prime + this.aaTitu.hashCode();
		
		return hash;
    }
}